﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RegisterProvider.ascx.cs" Inherits="Parts_RegisterProvider" %>

<script language="JavaScript" type="text/JavaScript">
<!--
    var detect = navigator.userAgent.toLowerCase();
    checkIt = function (string) { return detect.indexOf(string) + 1; }

    function OpenRDR(url) {
        if ((screen.availHeight >= 0) && (screen.availWidth >= 0)) {
            var height = screen.availHeight - 50;
            var width = screen.availWidth - 10;
        }
        else if ((screen.Height >= 0) && (screen.Width >= 0)) {
            var height = screen.Height - 90;
            var width = screen.Width - 10;
        }

        if (checkIt('aol')) {
            width = width - 10;
            height = height - 130;
        }

        msg = window.open(url, "rdr", "toolbar=0,status=no,location=no,menubar=no,"
            + "directories=no,scrollbars=no,resizable=no,screenX=0,screenY=0,left=0,"
            + "top=0,width=" + width + ",height=" + height);
    }

    var googleAnalyticsTrans = {
        OrderId: "",
        Total: ""
    }

    function LoginForm() {
        var error = false;
        //ten dang nhap
        if (document.login_form.txtLoginUsername.value == "") {
            document.login_form.txtLoginUsername.focus();
            document.getElementById('ErrorLoginUsername').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorLoginUsername').innerHTML = "";
        }

        //mat khau
        if (document.login_form.txtLoginPassword.value == "") {
            document.login_form.txtLoginPassword.focus();
            document.getElementById('ErrorLoginPassword').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorLoginPassword').innerHTML = "";
        }


        if (error == false) {           
            return true;
        }
        return false;
    }

    function ForgottenPassword() {
        var checkEmail = document.forgot_form.txtLoginEmail.value;
        checkEmail = checkEmail.replace(/ /gi, "");

        if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length - 4) != '.')
                && (checkEmail.charAt(checkEmail.length - 3) != '.'))) {
            //alert("Error: Please enter a valid email address.");
            document.forgot_form.txtEmail.focus();
            document.getElementById('ErrorLoginEmail').innerHTML = "Vui lòng nhập địa chỉ e-mail hợp lệ.";
            return false;
        }
        else {
            document.getElementById('ErrorLoginEmail').innerHTML = "";
        }

        //submit form
        //forgot_form.method="post";
        //forgot_form.action="/account/forgotten.asp"; 
        //forgot_form.submit();

        return true;
    }

    function ValidateForm() {
        var error = false;
        //ten dang nhap
        if (document.form_register.txtRegisterProviderUsername.value == "") {
            document.form_register.txtRegisterProviderUsername.focus();
            document.getElementById('ErrorRegisterProviderUsername').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterProviderUsername').innerHTML = "";
        }

        //mat khau
        if (document.form_register.txtRegisterProviderPassword.value == "") {
            document.form_register.txtRegisterProviderPassword.focus();
            document.getElementById('ErrorRegisterProviderPassword').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterProviderPassword').innerHTML = "";
        }

        //xac nhan mat khau

        if (document.form_register.txtRegisterConfirmProviderPassword.value == "") {
            document.form_register.txtRegisterConfirmProviderPassword.focus();
            document.getElementById('ErrorRegisterConfirmProviderPassword').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterConfirmProviderPassword').innerHTML = "";
        }


        //ten nha cung cap
        if (document.form_register.txtRegisterProviderName.value == "") {
            document.form_register.txtRegisterProviderName.focus();
            document.getElementById('ErrorRegisterProviderName').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterProviderName').innerHTML = "";
        }


        //ten dang nhap nha cung cap
        if (document.form_register.txtRegisterPartnerUsername.value == "") {
            document.form_register.txtRegisterPartnerUsername.focus();
            document.getElementById('ErrorRegisterPartnerUsername').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterPartnerUsername').innerHTML = "";
        }

        //mat khau nha cung cap
        if (document.form_register.txtRegisterPartnerPassword.value == "") {
            document.form_register.txtRegisterPartnerPassword.focus();
            document.getElementById('ErrorRegisterPartnerPassword').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterPartnerPassword').innerHTML = "";
        }


        //credit card number
        if (document.form_register.txtRegisterCreditCardNumber.value == "") {
            document.form_register.txtRegisterCreditCardNumber.focus();
            document.getElementById('ErrorRegisterCreditCardNumber').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterCreditCardNumber').innerHTML = "";
        }



        //link ws
        if (document.form_register.txtRegisterLinkWS.value == "") {
            document.form_register.txtRegisterLinkWS.focus();
            document.getElementById('ErrorRegisterLinkWS').innerHTML = "Thuộc tính được yêu cầu.";
            error = true;
        }
        else {
            document.getElementById('ErrorRegisterLinkWS').innerHTML = "";
        }

        if (error == false) {
           return true;
        }
        return false;
    }

    function showStuff(id) {
        document.getElementById(id).style.display = 'block';
    }

    function checkInput(input1, input2, errLoc, err) {
        if (document.getElementById(input1).value != document.getElementById(input2).value) {
            document.getElementById(errLoc).innerHTML = err + " không trùng khớp.";
        }
        else {
            document.getElementById(errLoc).innerHTML = "";
        }
    }

    function clearError(id) {
        document.getElementById(id).innerHTML = "";
    }
-->
</script>
<div class="account-box-content">     
	<div class="account-box clearfix" style="height:701px;">
    	<div class="left box floatLeft" style="height:700px;">
        	<div class="corner tl"></div>
            <div class="corner bl"></div>
			<h3 class="title">Đăng nhập</h3>

<center>
    <p>
        <asp:Label ID="lblLoginMsg" runat="server" ForeColor="Red" Visible="False" 
            Font-Bold="True" Font-Size="Small"></asp:Label>
    </p>
</center>

            <form onsubmit="return LoginForm();" name="login_form" action="" method="post">
                <div class="field-container">
                    <label for="txtLoginUsername" class="label">Tên đăng nhập:</label>
                    <input type="text" class="text-box" onclick="clearError('ErrorLoginUsername')" name="txtLoginUsername" id="txtLoginUsername"/>
                    <div class="error-msg" id="ErrorLoginUsername"></div>
                </div>
                <div class="field-container">
                    <label for="txtLoginPassword" class="label">Mật khẩu</label>
                    <input type="password" class="text-box" onclick="clearError('ErrorLoginPassword')" name="txtLoginPassword" id="txtLoginPassword"/>
                    <div class="error-msg" id="ErrorLoginPassword"></div>
                </div>
                <div style="height: 10px;" class="field-container">
                    
                </div>
                <div class="field-container button-container">
                    
                    <div class="button clearfix">
                        <div class="left"></div>
                        <input type="submit" value="Đăng nhập"/>
                        <div class="right"></div>
                    </div>
                </div>
            </form>

            <div style="height: 15px" class="field-container">
                <a class="forgot-password" onclick="showStuff('forgotPassMsg'); showStuff('forgotPass'); showStuff('forgotPassBtn'); return false;" href="#" name="forgotten">Quên mật khẩu?</a>
            </div>
            <div style="height: 20px;display: none;" class="field-container" id="forgotPassMsg">
                <p style="width: 245px;">Nhập địa chỉ email bạn tại đây và mật khẩu sẽ được gửi đến bạn.</p>
            </div>
            <form onsubmit="return ForgottenPassword();" name="forgot_form" action="" method="post">
                <div style="display: none;" class="field-container" id="forgotPass">
                        <label for="txtEmail" class="label">Địa chỉ email:</label>
					    <input class="text-box" id="txtLoginEmail" name="txtLoginEmail"/>
					    <div class="error-msg" id="ErrorLoginEmail"></div>
                </div>
                <div style="display: none;" class="field-container button-container" id="forgotPassBtn">
                    <div class="button clearfix">
                        <div class="left"></div>
                        <input type="submit" value="Gửi"/>
                        <div class="right"></div>
                    </div>
                </div>
            </form>
        </div>

        <div class="right box floatLeft" style="height:700px;">
	        <div class="corner tr"></div>
            <div class="corner br"></div>
			<h3 class="title">Đăng ký</h3>
            <center>
    <p>
        <asp:Label ID="lblRegister" runat="server" ForeColor="Red" Visible="False" 
            Font-Bold="True" Font-Size="Small"></asp:Label>
    </p>
</center>
            <form onsubmit="return ValidateForm();" method="post" action="" name="form_register">
                <input type="hidden" name="act" id="act" value="register" />

                <div class="field-container">
                    <label for="txtRegisterProviderUsername" class="label">Tên đăng nhập:</label>
                    <input type="text" value="" maxlength="20" class="text-box" onclick="clearError('ErrorRegisterProviderUsername')" name="txtRegisterProviderUsername" id="txtRegisterProviderUsername"/>
                    <div class="error-msg" id="ErrorRegisterProviderUsername"></div>
                </div>
                <div class="field-container">
                    <!--<a name="txtEmail"></a>-->
                    <label for="txtRegisterProviderPassword" class="label">Mật khẩu:</label>
                    <input type="password" value="" maxlength="20" class="text-box" onclick="clearError('ErrorRegisterProviderPassword')" name="txtRegisterProviderPassword" id="txtRegisterProviderPassword"/>
                    <div class="error-msg" id="ErrorRegisterProviderPassword"></div>
                </div>
                <div class="field-container">
                    <label for="txtRegisterConfirmProviderPassword" class="label">Xác nhận mật khẩu:</label>
                    <input type="password" value="" maxlength="20" id="txtRegisterConfirmProviderPassword" class="text-box" onclick="clearError('ErrorRegisterConfirmProviderPassword')"  onchange="checkInput('txtRegisterConfirmProviderPassword', 'txtRegisterProviderPassword', 'ErrorRegisterConfirmProviderPassword', 'Xác nhận mật khẩu ')" name="txtRegisterConfirmProviderPassword"/>
                    <div class="error-msg" id="ErrorRegisterConfirmProviderPassword"></div>
                </div>
                <div class="field-container">
                    <!--<a name="txtPassword"></a>-->
                    <label for="txtRegisterProviderName" class="label">Tên nhà cung cấp:</label>
                    <input type="text" class="text-box" onclick="clearError('ErrorRegisterProviderName')" value="" maxlength="50" id="txtRegisterProviderName" name="txtRegisterProviderName"/>
                    <div class="error-msg" id="ErrorRegisterProviderName"></div>
                </div>
                <div class="field-container">
                    <label for="txtRegisterPartnerUsername" class="label">Tên đăng nhập webservice:</label>
                    <input type="text" class="text-box"  onclick="clearError('ErrorRegisterPartnerUsername')" value="" maxlength="20" id="txtRegisterPartnerUsername" name="txtRegisterPartnerUsername"/>
                    <div class="error-msg" id="ErrorRegisterPartnerUsername"></div>
                </div>

                 <div class="field-container">
                    <label for="txtRegisterPartnerPassword" class="label">Mật khẩu đăng nhập webservice:</label>
                    <input type="password" class="text-box"  onclick="clearError('ErrorRegisterPartnerPassword')" value="" maxlength="20" id="txtRegisterPartnerPassword" name="txtRegisterPartnerPassword"/>
                    <div class="error-msg" id="ErrorRegisterPartnerPassword"></div>
                </div>

                <div class="field-container">
                    <label for="txtRegisterCreditCardNumber" class="label">Credit card numer:</label>
                    <input type="text" class="text-box" onclick="clearError('ErrorRegisterCreditCardNumber')"  value="" maxlength="20" id="txtRegisterCreditCardNumber" name="txtRegisterCreditCardNumber"/>
                    <div class="error-msg" id="ErrorRegisterCreditCardNumber"></div>
                </div>

                <div class="field-container">
                    <label for="txtRegisterLinkWS" class="label">Link webservice:</label>
                    <input type="text" class="text-box" onclick="clearError('ErrorRegisterLinkWS')" value="" maxlength="20" id="txtRegisterLinkWS" name="txtRegisterLinkWS"/>
                    <div class="error-msg" id="ErrorRegisterLinkWS"></div>
                </div>
              

                <div class="field-container">                    
                    <div class="button clearfix">
                        <div class="left"></div>
                        <input type="submit" value="Đăng ký"/>
                        <div class="right"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>        
</div>
<div class="clear"></div>